package com.kyh.controller.api.sys;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kyh.service.sys.AdminService;
import com.kyh.vo.R;

@Controller
public class ApiController {
	
	private static final Logger logger = Logger.getLogger(ApiController.class);
	
	@Autowired
	private AdminService adminService;
	
	@PostMapping("/login")
	@ResponseBody
	public R login(
			HttpServletRequest request,
			HttpServletResponse response,
			String adminloginname,
			String adminpassword,
			String imgcodevalue
			) {
		logger.info("adminloginname---" + adminloginname + "，adminpassword---" + adminpassword);
		
		return adminService.login(
				request,
				response,
				adminloginname,
				adminpassword,
				imgcodevalue
				);
	}
	
}
